from PIL import Image


def resize_image(image_path, width, height):
    """
    调整图像大小
    :param image_path: 图像路径
    :param width: 目标宽度
    :param height: 目标高度
    :return: 无返回值，直接保存调整后的图像
    """
    try:
        with Image.open(image_path) as img:
            resized_img = img.resize((width, height))
            resized_img.save(image_path)
        return True, "图像大小调整成功！"
    except Exception as e:
        return False, f"操作失败：{str(e)}"
